# -*- coding: utf-8 -*-

# $Id: list.py 2 2012-09-01 15:54:17Z alexis.roda.villalonga@gmail.com $

from dja_skel.skeletons.base import BaseModelViewSkel


class ListViewSkel(BaseModelViewSkel):
    variables = ("applabel", "ModelName")
    skeleton_path = "templates/list"
    summary = "Skeleton that creates a CBV list view."

    def get_view_module_map(self):
        context = self._context
        return [(
            "{}_list".format(context["model_name"]),
            "{}_list_view".format(context["model_name"]),
            )]

    def get_view_url_map(self):
        context = self._context
        return [(
            r"^{}/list/$".format(context["model_name"]),
            "{}_list_view".format(context["model_name"]),
            )]
